# 一、猜数字
import random
com_num = random.randint(1,100)
w_num = int(input("请输入数字："))
if w_num == com_num:
    print("猜对了")
elif w_num > com_num:
    print("太大了")
elif w_num < com_num:
    print("太小了")
print(f"电脑随机数是{com_num},你输入的值是{w_num}")

# 二、登录账户
for i in range(0,3):
    login_zh = input("请输入账号：")
    login_password = int(input("请输入密码："))
    if login_zh == "wyw12" and login_password == 123:
        print("恭喜你，登录成功！！")
        break
    else:
        print("账号密码错误，请重试")

# 三、bmi指数计算器

Height = float(input("请输入身高(单位：米):"))
Weight = int(input("请输入体重(单位：千克):"))
bmi = (Weight /(Height**2))
if bmi <18:
    print(f"BMI指数为：{'%.2f'%bmi},体重较轻")
elif 18<bmi<24:
    print(f"BMI指数为：{'%.2f'%bmi},体重正常")
elif 24<bmi<28:
    print(f"BMI指数为：{'%.2f'%bmi},偏胖")
else:
    print(f"BMI指数为：{'%.2f'%bmi},超重，该减肥了")

# 四 成绩评级
chengji = int(input("你的分数："))
if chengji <60:
    print("不及格")
elif chengji>60 and chengji<=80:
    print("良好")
else:
    print("优秀")

# 五 猜拳游戏
import random
user_choice = input("你要出：")
com_choice = random.choice(["石头","剪刀","布"])
print("系统：{}".format(com_choice))
if user_choice == com_choice:
    print("平局")
elif (com_choice,user_choice) in [("剪刀","石头"),("石头","布"),("布","剪刀")]:
    print("恭喜你，你赢了！")
elif (user_choice,com_choice) in [("剪刀","石头"),("石头","布"),("布","剪刀")]:
    print("你输了")

# 六 年龄分类
age = int(input("你的年龄："))
if age <18:
    print("未成年")
elif 18< age <35:
    print("青年")
elif 35< age <55:
    print("中年")
else:
    print("老年")
